import React, { PureComponent } from 'react';


class App extends PureComponent {
  constructor(props) {
    super(props)
    this.state = {
      isActive: true,
    }
  }
  render() {
    const {isActive} = this.state
    return (
      <div>
        <h2 className={"foo bar active title"}>我是标题一</h2>
        <h2 className={"title"+(isActive ? " active": "")}>我是标题二</h2>
        <h2 className={["title", (isActive ? "active": "")]}>我是标题三</h2>
      </div>
    );
  }
}


export default App;